Release 10.1A: OpenEdge Development:
Programming Interfaces
Sample ProDataSet to XML round-trip
One of the most important use cases for the features described in this chapter is that of the XML round-trip. XML can be a persistent storage mechanism between Progress sessions. For example, a mobile computing model could use XML as a persistent data store. Suppose, a sales representative could work off-line from the server with a local copy of selected records, limited to his accounts, stored as XML. The mobile application could read the XML and work locally. The changes made off-line by the sales representative on the records would be stored locally as an updated XML file, storing before-image data as well. When the sales representative reconnects to the system, the XML would be sent back to the application server to synchronize with enterprise application. The application code could decide whether to apply the remote changes or overwrite with server changes. The before-image data could be used to compare changes that might have been made while the sales representative was working remotely.”
All you need to do is create a an XML write procedure to store your data and an XML read procedure to retrieve it. Of course, you must ensure that the
min-xmlschemaoption is set toFALSE. That is, you want Progress to write its own XML Schema extensions so that the 4GL definitions are fully restored when the file is read back in.This include file sets up a pair of temp-tables and a ProDataSet for the two code samples to use:
The first code sample performs an XML write and informs you if it has been successful:
The second code sample performs an XML read and informs you if it has been successful:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |